import React, {Component} from 'react'
import './index.css'

export default class State extends Component{
    render(){
        // 接收state参数
        const {id,name} = this.props.location.state || {}
        console.log(this.props)
        return (
            <div>
                <button onClick={() => this.props.history.goBack()}>返回</button>
                <br/>
                <div>
                    接收id: { id }&nbsp;&nbsp;&nbsp;
                    接收name: { name }
                </div>
            </div>
        )
    }
}
